package com.example.helloservice.controller;

import com.example.api.domain.Person;
import org.springframework.web.bind.annotation.*;

/**
 * hello-service
 * @date 2019-4-19 10:06:11
 * @author joker
 */
@RestController
@RequestMapping("/eureka/client")
public class HelloController {

    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }

    @GetMapping("hello1")
    public String hello1(@RequestParam("name") String name){
        return name;
    }

    @GetMapping("/hello2")
    public String hello2(@RequestHeader("name") String name, @RequestHeader("age") Integer age){
        return name+":"+age;
    }

    @PostMapping("/hello3")
    public String hello3(@RequestBody Person person){
        return person.toString();
    }
}
